Hi,
I'm creating a SF Symbols image like this:
var img = UIImage(systemName: "x.circle" ,withConfiguration: symbolConfig)!.withTintColor(.red)
In the debugger the image is really red.
and I'm using this image to create a SKTexture:
let shuffleTexture = SKTexture(image: img)
The texture image is ALWAYS black and I have no idea how to change it's color. Nothing I've tried so far works.
Any ideas how to solve this?
Thank you!
Best Regards,
Frank
Post
Replies
Boosts
Views
Activity
Hi,
I'm having a small App in the AppleTV-Simulator which is supposed to use the Siri-Remotes Swipe-Gesture.
It works perfect on the real device but on the simulator the Swipe-Gesture is not recognized in the App but it works on the Start-Screen of the Simulator using the simulated Siri-Remote app.
Here is the code which sets up the xAxis ans yAxis value change handlers:
#if targetEnvironment(simulator)
// Simulator
let siriRemote = GCController.controllers().filter { controller in
if controller.vendorName == "Gamepad" {
return true
} else {
return false
}
}
let sController = siriRemote.first!
let inputProfile = sController.physicalInputProfile
let dPad = inputProfile.dpads["Direction Pad"]
self.dPad = dPad
self.dPad!.xAxis.valueChangedHandler = self.directionPadXAxisValueChangeHandler
self.dPad!.yAxis.valueChangedHandler = self.directionPadYAxisValueChangeHandler
}
#else
// Device
if let _ = ( notification.object as? GCController)?.microGamepad {
let microProfileController = notification.object as! GCController
self.microGamePad = microProfileController.microGamepad
self.dPad = self.microGamePad!.dpad
self.dPad!.xAxis.valueChangedHandler = self.directionPadXAxisValueChangeHandler
self.dPad!.yAxis.valueChangedHandler = self.directionPadYAxisValueChangeHandler
}
#endif
Any help is greatly appreciated.
Cheers,
Frank
Hi,
I've tried to find a solution for this problem for weeks now but it seems no one knows how to solve it and Apple doesn't seem to care.
I have a NavigationSplitView with two columns. In the detail column I have a button - or any other clickable control - which is placed in the very top where usually the safe area resides.
The button is NOT clickable when he is in the safe area and I have NO idea why. I know I can place buttons in safe areas of other views and they are clickable.
Please have a look at the code:
`struct NavTestView: View {
var body: some View {
GeometryReader { p in
VStack(spacing: 0) {
NavigationSplitView {
List(names) {
Text($0.name).frame(width: p.size.width)
.background(Color.green)
}.listRowSpacing(p.size.height * 0.15 / 100 )
.toolbar(.hidden, for: .navigationBar)
} detail: {
TestView().ignoresSafeArea()
}.frame(width: p.size.width, height: p.size.height, alignment: .topLeading)
.background(Color.yellow)
}
}
}
}
struct TestView: View {
var body: some View {
GeometryReader { p in
let plusButton = IconButton(imageName: "plus.circle.fill", color: Color(uiColor: ThemeColor.SeaFoam.color),
imageWidth: p.size.width * 5 / 100, buttonWidth: p.size.width * 5 / 100)
let regularAddButton = Button(action: { log.info("| Regular Add Button pressed") } ) {
plusButton
}
VStack {
regularAddButton
}.frame(width: p.size.width , height: p.size.height, alignment: .top)
.background(Color.yellow)
}
}
}
`
this code produces the following screen:
Any help would be really greatly appreciated!
Thank you!
Frank
Hi,
I have a NavigationSplitView with a view in the detail section:
NavigationSplitView {
ZStack {
Color.black.ignoresSafeArea()
gradientBlack2Blue.opacity(0.25)
.ignoresSafeArea()
GeometryReader { p in
VStack {
List {
SidebarViewCell(id: "1",
text: "Steuersätze" ,
type: .TAX_MASTERDATA ,
selectedMasterdataType: $selectedMasterdataType)
}.listRowSpacing(size.height * 1.25 / 100 )
.scrollContentBackground(.hidden)
.toolbar(.hidden, for: .navigationBar)
.frame(width: p.size.width * 98 / 100 , height: p.size.height,
alignment: .topLeading).
}alignment: .topLeading)
}
}
}
detail: {
MasterdataDetailView().ignoresSafeArea()
}
}.navigationSplitViewStyle(.balanced)
When I place a Button-Control in the MasterdataDetailView it cannot be clicked because it is in the safe area. How can I make it clickable?
Best Regards,
Frank
I don't understand why the green button in the yellow view is NOT clickable, because it is in a "safe area" of the detail section and the blue button at the top is clickable, even tough it is in the "safe area" too?
I have NO idea:
I create a record in CloudKit using the CloudKit Dashboard. The record also contains an attribute for a photo, which I upload before saving the record. The photo data is stored in an attribute of the type CKAsset. In the entity core data date model it is represented as an attribute of type Data.
When I do a NSFetchRequest later on my local sqlLite DB which synchronises with CloudKit the attribute which is supposed to hold the binary data of the image is always nil. All the other attributes - which are just strings - are filled with valid data. When I change these attributes and do a NSFetchRequest again the changes are reflected in the fetch result.
I have no idea why the photo attribute is always nil and the other string attributes contain the current valid value.
Here is some sample code from the project.
This is the code which fetches it from the local sqlite DB which is backed by CloudKit and where the photo attribute is nil even it is provided in CloudKit:
let bgContext = self.newBackgroundContext()
bgContext.perform {
do {
fetchRequest.propertiesToFetch = ["title", "categoryValue", "date", "photo", "amount"]
let results = try fetchRequest.execute() as! [ReceiptEntity]
for record in results {
let title = record.title
let photo = record.photo
if let photo_local = photo {
log.info("| Photo attribute is present!!")
}
}
}
} catch let error {
let result: Result<[ReceiptEntity], Error> = .failure(error)
cb(result)
}
This is the Entity definition, generated by Xcode:
extension ReceiptEntity {
@nonobjc public class func fetchRequest() -> NSFetchRequest<ReceiptEntity> {
		return NSFetchRequest<ReceiptEntity>(entityName: "ReceiptEntity")
}
@NSManaged public var additionalInformation: String?
@NSManaged public var amount: Double
@NSManaged public var categoryValue: String?
@NSManaged public var currencyValue: String?
@NSManaged public var date: Date?
@NSManaged public var placeMark: String?
@NSManaged public var title: String?
@NSManaged public var photo: Data?
}
As already mentioned before: When I fetch a certain record from CloudKit directly using the following code - the photo attribute has a CKAsset instance and the photo is there:
	privateDB.fetch(withRecordID: configRecordId) { (record, error) -> Void in
				let photo = record?.value(forKey: "CD_photo") as? CKAsset
				let title = record?.value(forKey: "CD_title") as? String
				
				if let url = photo?.fileURL {
						log.info("| Asset URL: \(url)")
				}
		}